#include <iostream>
#include <string>

using namespace std;

class myStr
{
private:
    char* data;
    int length;

    int* next;
    int* nextVal;

public:
    myStr(const char*ch);
    ~myStr();
    //其他可以考虑的构造函数
    //myStr(const int&);
    //myStr(const myStr&);

    void print();
    void kmp_next();
    void kmp_nextVal();
    void printNext();
    void printNextVal();

    friend bool replaceStr(myStr& S, const int& start, const myStr& T, const myStr& V);
    friend int kmpMatch(const myStr& S, const myStr& T);
    friend int simpleMatch(const myStr& S, const myStr& T);

};

struct matrixNode
{
    int row;
    int col;
    int value;
};


class myMatrix
{
private:
    matrixNode* nodeList;
    int rowNum;
    int colNum;
    int nodeNum;

public:
    myMatrix(const int& rNum, const int& cNum, const int& nNum, const int* i);
    ~myMatrix();
    myMatrix();

    void printMatrix();
    void FastTransposeSMatrix(myMatrix& T);
};







